-
-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IPFS nodes healthcheck and API client #618
IPFS nodes healthcheck and API client #618
Conversation
Fix undefined message Co-authored-by: bludnic <[email protected]>
…also displayed in the list
fix: commands shouldn't be in ASC order
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
import IpfsNodesTableItem from './IpfsNodesTableItem.vue' | ||
import { sortNodesFn } from '@/components/nodes/utils/sortNodesFn' | ||
|
||
const className = 'adm-nodes-table' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const className = 'adm-nodes-table' | |
const className = 'ipfs-nodes-table' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also add this selector in <style> block. Leave empty if no styles
const computedResult = computed(() => { | ||
const baseUrl = new URL(url.value) | ||
const protocol = baseUrl.protocol | ||
const hostname = baseUrl.hostname | ||
const port = baseUrl.port | ||
const result = /^[\d.]+$/.test(hostname) | ||
|
||
let nodeName = null | ||
let domain = null | ||
|
||
if (!result) { | ||
const regex = /([^.]*)\.(.*)/ | ||
const parts = hostname.match(regex) | ||
if (parts !== null) { | ||
nodeName = parts[1] | ||
domain = parts[2] | ||
} | ||
} | ||
|
||
return { | ||
protocol, | ||
hostname, | ||
nodeName, | ||
domain, | ||
result, | ||
port | ||
} | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you convert this part into a hook and reuse it in both components: IpfsNodesTableItem.vue
and AdmNodesTableItem.vue
?
Example of usage:
const { protocol, hostname, nodeName, domain, result, port } = useNodeUrl(url);
Put the hook in src/components/nodes/hooks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's important not to lose the reactivity of protocol
, hostname
, etc., after destructuring. You probably need to use toRefs
inside the hook.
/** | ||
* Provides methods for calling the ADAMANT API. | ||
* | ||
* The `ApiClient` instance automatically selects an ADAMANT node to | ||
* send the API-requests to and switches to another node if the current one | ||
* is not available at the moment. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update JSDoc: ADAMANT API -> IPFS NODE API
Added IPFS nodes to adamant-wallets You can regenerate the config using the PR branch: |
Duplicates #625 |
No description provided.